package com.zhuang.mediator;

/**
 * @Classname Client
 * @Description 中介者模式 测试类
 * @Date 2021/3/28 20:47
 * @Created by dell
 */

public class Client {
    public static void main(String[] args) {
        //房主 租房者 中介机构
        MediatorStructure mediator = new MediatorStructure();

        //房主和租房者只需要知道中介机构即可
        HouseOwner houseOwner = new HouseOwner("张三", mediator);
        Tenant tenant = new Tenant("李四", mediator);

        //中介机构需要知道房主和租房者
        mediator.setHouseOwner(houseOwner);
        mediator.setTenant(tenant);

        tenant.constact("需要租一间房子");
        houseOwner.constact("我有一间房子，你要租吗？？？");

    }
}
